<?php
	/**
	 * The event class is a simple value container for events.
	 */
	class Event {
		/**
		 * Date and time of the event
		 */
		private $dateTime;
		
		/**
		 * A title for the event
		 */
		private $title;
		
		/**
		 * A description for the event
		 */
		private $description;
		
		/**
		 * Whether or not the event is approved
		 */
		private $pending;
		
		/**
		 * Initializes a new instance of the Event class.
		 * 
		 * @param DateTime $dateTime Date and time of the event
		 * @param string $title A title for the event
		 * @param string $description A description for the event
		 * @param bool $pending Whether or not the event is approved
		 */
		public function __construct($dateTime, $title, $description = '', $pending = false) {
			$this->setDateTime($dateTime);
			$this->setTitle($title);
			$this->setDescription($description);
			$this->setPending($pending);
		}

		/**
		 * Gets the date and time of the event.
		 * 
		 * @return DateTime Date and time of the event
		 */
		public function getDateTime() {
			return $this->dateTime;
		}
		
		/**
		 * Sets the date and time of the event.
		 * 
		 * @param DateTime Date and time of the event
		 * @return void
		 */
		public function setDateTime($dateTime) {
			$this->dateTime = $dateTime;
		}
		
		/**
		 * Gets the event's title.
		 * 
		 * @return string the event's title
		 */
		public function getTitle() {
			return $this->title;
		}
		
		/**
		 * Sets the event's title.
		 * 
		 * @param string $title A title for the event
		 * @return void
		 */
		public function setTitle($title) {
			$this->title = $title;
		}

		/**
		 * Gets the event's description.
		 * 
		 * @return string The event's description
		 */
		public function getDescription() {
			return $this->description;
		}

		/**
		 * Sets the event's description.
		 * 
		 * @param string $description A description for the event
		 * @return void
		 */
		public function setDescription($description) {
			$this->description = $description;
		}

		/**
		 * Gets the event's status.
		 * 
		 * @return bool TRUE if the event is pending; otherwise FALSE
		 */
		public function getPending() {
			return $this->pending;
		}

		/**
		 * Sets the event's status.
		 * 
		 * @param bool TRUE if the event is pending; otherwise FALSE
		 * @return void
		 */
		public function setPending($pending) {
			$this->pending = (bool)$pending;
		}
	}